package com.example.echoewish.repository;


import com.example.echoewish.repository.network.PreConcernServiceNetWork;
import com.example.echoewish.util.LogUtil;

import retrofit2.Callback;

public class PreConcernRepository {
    private final  static PreConcernRepository instance=new PreConcernRepository();

    public static PreConcernRepository getInstance()
    {
        return instance;
    }

    public void sendConcernRequest(int hostId, int friId, Callback callback)
    {
        try {
            PreConcernServiceNetWork.sendConcernRequest(hostId,friId,callback);
            new LogUtil().w(LogUtil.GET_DATA_TAG,"发送好友请求接口 调用成功");
        }
        catch (Exception e)
        {
            new LogUtil().w(LogUtil.GET_DATA_TAG,"发送好友请求接口 调用失败");
        }
    }

    public void acceptConcernRequest(int hostId, int friId, Callback callback)
    {
        try
        {
            PreConcernServiceNetWork.acceptConcernRequest(hostId,friId,callback);
            new LogUtil().w(LogUtil.GET_DATA_TAG,"接受好友请求接口 调用成功");
        }catch (Exception e)
        {
            new LogUtil().w(LogUtil.GET_DATA_TAG,"接受好友请求接口 调用成功");
        }
    }

    public void refuseConcernRequest(int hostId, int friId, Callback callback)
    {
        try {
            PreConcernServiceNetWork.refuseConcernRequest(hostId,friId,callback);
            new LogUtil().w(LogUtil.GET_DATA_TAG,"拒绝好友请求接口 调用成功");
        }
        catch (Exception e)
        {
            new LogUtil().w(LogUtil.GET_DATA_TAG,"拒绝好友请求接口 调用成功");
        }
    }

    public void getMyPreConcernRequests(int hostId,Callback callback)
    {
        try {
            PreConcernServiceNetWork.getMyPreConcernRequests(hostId,callback);
            new LogUtil().w(LogUtil.GET_DATA_TAG,"获取好友请求接口 调用成功");
        }
        catch (Exception e)
        {
            new LogUtil().w(LogUtil.GET_DATA_TAG,"获取好友请求接口 调用成功");
        }
    }
}
